<template>
<!-- Confirm 全局确认对话框 -->
<Modal v-model="visible" :title="title" :mask-closable="false" class="vertical-center-modal" :footer-hide="true" :width="width" @on-ok="submit">
    <div v-if="htmlContext" v-html="htmlContext"></div>
    <p v-else style="text-align:center;margin: 25px 0px;padding: 0px 20px;">{{context}}</p>
    <div class="modal-footer">
        <Button @click="visible=false">取消</Button>
        <Debounce>
            <Button type="primary" @click="submit">{{okButText}}</Button>
        </Debounce>
    </div>
</Modal>
</template>

<script>
export default {
    name:'Confirm',
    data() {
        return {
            visible: false,
            title: '删除信息',
            context: '确定删除已选记录？',
            htmlContext:null,
            confirm:null,
            width:300,
            okButText:'确认',
        }
    },
    methods:{
        submit(){
            this.confirm();
            this.visible = false;
        }
    }
}
</script>
